﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Transactions;
using Zj.Blog.Domain.Interface;

namespace Zj.Blog.Repository
{
    public class UnitOfWork : IUnitOfWork
    {
        private TransactionScope trans;
        public UnitOfWork()
        {
            trans = new TransactionScope();
        }
        public void Dispose()
        {
            if (null!=trans)
            {
                trans.Dispose();
            }
        }

        public void Save()
        {
            trans.Complete();
        }
    }
}
